package com.log.james.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Date;
import java.util.Map;

@Mapper
public interface WebFlowDao {
    @Select("select f.curstream as curStream,f.upstream as maxStream, f.downstream as minStream from weblogflow f where f.endTime = #{time}")
    Map<String,Object> getWebFlow(@Param("time")Date time);

    @Select("select count(curStream) from weblogflow where starttime >= #{st} and endtime < #{et}")
    int getFlowNum(@Param("st")Date st,@Param("et")Date et);

    /**
     * 特定时间段内web日志的数量
     * @param st
     * @param et
     * @return
     */
    @Select("select sum(times) from weblogstatistics where starttime >= #{st} and endtime <= #{et}")
    int getLogsNum(@Param("st")Date st,@Param("et")Date et);
}
